<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib  prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>front应用列表</title>
    
	<link  rel="stylesheet" type="text/css" href="assets/plugins/bootstrap/css/bootstrap.css"/>
	<link href="assets/css/style.css" rel="stylesheet"/>
	<script type="text/javascript">	
	function checkform(){
		
		checked=false;
		if(document.getElementById("name").value!="")
		{
			checked=true;
		}
		if (!checked){
			alert('请输入搜索信息');
			return false;
		}
	}
	</script>
	<style type="text/css">
		
		body {
                padding-top:60px;
                padding-bottom:40px;
            }
	</style>
  </head>
  
  <body>
    <jsp:include page="../../Template/home_top.jsp"></jsp:include>
  	<div class="mainbox container">
  			<div class="row">
  				<div class="span9">
			    <s:if test="detools.size > 0">
			    
			    <s:form name="form1" action="front/detool_query" method="post" >
			   		<s:textfield name="name" id="name"/>
			        <s:submit value="搜索" onclick="return checkform()"/>
				</s:form>
				
				    <table class="table table-hover table-strip table-border">
					    <tr><td>应用名</td><td>下载次数</td><td>上传时间</td><td>&nbsp;</td><td>&nbsp;</td></tr>
					    <s:iterator value="detools" var="detool">
					    	<tr>
					    	
					   		<td width="200"><s:property value="name"/></td>
					   		
					   		<td width="80"><s:property value="downloadcount"/></td>
					   		
					   		<td width="250"><s:date name="uploadtime" format="yyyy-MM-dd HH:mm:ss" /></td>
					   		
					   		<td width="80"><a href="front/detool_showDetail?id=${detool.id}">查看详情</a></td>
					   		
					   		<td width="80"><a href="front/detool_download?id=${detool.id}">点击下载</a></td>
					   		
					   		</tr>
					   	</s:iterator>
				   	</table>
			   	<p align="center">当前共有 <s:property value="rowCount"/> 条记录 | 当前共有 <s:property value="pageCount"/> 页 | 当前为 <s:property value="pageNow"/> 页</p>
			   	
			   	<!-- 页码超链接 -->
			   	
			   	<p align="center">
			   	
			   		<a href="front/detool_list?pageNow=1">首页</a>
			   		
			   		<s:if test="pageNow-1 >= 1">
			   			<a href="front/detool_list?pageNow=${pageNow-1 }">上一页</a>
			   		</s:if>
			   		<s:else>上一页</s:else>
			   		
			   		<s:if test="pageNow-2 >= 1">
			   			<a href="front/detool_list?pageNow=${pageNow-2 }">${pageNow-2 }</a>
			   		</s:if>
			   		
			   		<s:if test="pageNow-1 >= 1">
			   			<a href="front/detool_list?pageNow=${pageNow-1 }">${pageNow-1 }</a>
			   		</s:if>
			   		${pageNow }
			   		<s:if test="pageNow+1 <= pageCount">
			   			<a href="front/detool_list?pageNow=${pageNow+1 }">${pageNow+1 }</a>
			   		</s:if>
			   		
			   		<s:if test="pageNow+2 <= pageCount">
			   			<a href="front/detool_list?pageNow=${pageNow+2 }">${pageNow+2 }</a>
			   		</s:if>
			   		
			   		<s:if test="pageNow+1 <= pageCount">
			   			<a href="front/detool_list?pageNow=${pageNow+1 }">下一页</a>
			   		</s:if>
			   		<s:else>下一页</s:else>
			   		
			   		<a href="front/detool_list?pageNow=${pageCount }">尾页</a>
			   	</p>
			   	</s:if>
			   	<s:else>没有可供下载的应用，详情可咨询管理员</s:else>
			   	</div>
			   	<div class="span3">
			   		<div class="well">
            		<div class="">
            			<h3>管理入口</h3>
            		</div>
            		<div class="">
            			<a href="member_memberCenter">用户中心</a>
	                    <br>
	                    <a href="admin/member_memberList">管理员中心</a>
            		</div>
            	</div>
			   	</div>
			   	</div>

			</div>
		  	</div>
   <jsp:include page="../../Template/home_footer.jsp"/>

